﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace homework5
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Order> list = new List<Order>();
            Customer customer1 = new Customer("小a","男",18,"12000000000");
            Customer customer2 = new Customer("小b","男",19,"12000000001");
            Customer customer3 = new Customer("小c","男",20,"12000000002");
            Goods goods1 = new Goods("鞋子", 2, 100);
            Goods goods2 = new Goods("衣服", 3, 200);
            Goods goods3 = new Goods("包包", 1, 500);
            OrderDetails od1 = new OrderDetails(goods1);
            OrderDetails od2 = new OrderDetails(goods2);
            OrderDetails od3 = new OrderDetails(goods3);
            Order o1 = new Order(customer1, 1, od1);
            Order o2 = new Order(customer2, 2, od2);
            Order o3 = new Order(customer3, 3, od3);
            list.Add(o1);
            list.Add(o2);

            OrderService os = new OrderService(list);
            os.Add(o3);
            os.Print();
            Console.WriteLine();
            os.Delete(1);
            os.Print();
            Console.WriteLine();
            os.Amend(o3,customer1);
            os.Print();
            Console.WriteLine();
            Console.WriteLine(os.SearchByGoods("包包").ToString());
            Console.WriteLine();
            os.Sort((order1, order2) => order1.Details.Money.CompareTo(order2.Details.Money));
            os.Print();
            Console.WriteLine();
            os.Sort();
            os.Print();
            Console.WriteLine();
            os.Export();
            os.Import();
        }
    }
}
